<?php

declare (strict_types = 1);

namespace app\api\controller;

use app\common\model\Advertising as AdvertisingModel;
use think\facade\Log;
use think\response\Json;

/**
 * 广告位管理
 * Class Cart
 * @package app\api\controller
 */
class Ad extends Controller
{

    /**广告位详情
     * @return Json
     */
    public function detail(): Json
    {
        $params = $this->request->get();
        $this->validate(
            $params,
            [
                'type' => 'integer',
            ]
        );
        $model = new AdvertisingModel();
        $ad = $model->detail($params['type'] ?? 1);
        return $this->renderSuccess($ad);
    }

}
